from ._base import db
from .satree import TreeMixin


class DeptTree(db.Model,TreeMixin):
    __tablename__ = "deptree"
    __tree_output_fields__ = ["node_id","dept_name","sys_id","is_sys"]
    # tree_id = db.Column(db.Integer, default=0)  # 用来标识节点是哪一棵树的,默认为零,如果指定__tree_key__为其他值时，则以__tree_key__字段什来标识树，该字段就没有用。
    node_id = db.Column(db.String(50), primary_key=True)
    dept_name = db.Column(db.String(50), nullable=True)
    sys_id = db.Column(db.String(20), nullable=True)
    parent_id = db.Column(db.String(20))
    # tree_left = db.Column(db.Integer, default=0)
    # tree_right = db.Column(db.Integer, default=0)
    # tree_level = db.Column(db.Integer, default=0)
    is_valid = db.Column(db.Integer, nullable=True, default=1)
    is_sys = db.Column(db.Integer, nullable=True)


